﻿using System;

class FindBiggerElement
{
    static void Main(string[] args)
    {
        int[] array = { 2, 6, 6, 2, -4, 16, 15, 20, 18, 0, 9, 1 };

        // Printing the array on the console
        for (int i = 0; i < array.Length; i++)
        {
            Console.WriteLine("[{0,2}] = {1,2}", i, array[i]);
        }

        Console.WriteLine();

        int index = IndexOfFirstBiggerElem(array);
        Console.WriteLine("The first element in the array that is bigger than its neighbors is: [{0}] = {1}",
            index, array[index]);
    }

    static int IndexOfFirstBiggerElem(int[] array)
    {
        for (int i = 0; i < array.Length; i++)
        {
            int index = NeighbourElementsComparison.CompareNeighbourElement(array, i);

            if (index > -1)
            {
                return index;
            }
        }

        return -1;
    }
}